/*
 * gpio.h
 *
 *  Created on: Aug 18, 2012
 *      Author: drew
 */

#ifndef GPIO_H_
#define GPIO_H_

typedef enum
{
  GPIO_IN,
  GPIO_OUT
} eGPIODirection;

typedef struct
{
  int            iPort;
  int            iPin;
  int            iSystemPinNumber;
  eGPIODirection eDirection;
  int            iPullUp;
  int            iPullDown;
} xGPIODescription, * xpGPIODescription, * GPIOObject;

xpGPIODescription xpGPIOCreateObject( int iPort, int iPin, eGPIODirection eDirection);
void vGPIODestroyObject( xpGPIODescription xpGPIO );
int iGPIOInitialize( xpGPIODescription xpGPIO );
int iGPIOCleanup( xpGPIODescription xpGPIO );
int iGPIOSetOutput( xpGPIODescription xpGPIO );
int iGPIOClearOutput( xpGPIODescription xpGPIO );
int iGPIOReadInput( xpGPIODescription xpGPIO );


#endif /* GPIO_H_ */
